C51 COMPILER V7.06   MAIN                                                                  10/31/2008 13:23:20 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN .\OUT\main.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c BROWSE DEBUG OBJECTEXTEND PRINT(.\LST\main.lst) OBJECT(.\OUT\main.ob
                    -j)

stmt level    source

   1          #include "STC89C51RC_RD_PLUS.h"
   2          #include "DEFINE.h"
   3          
   4          extern void isp_program_byte(uint add, uchar dat);
   5          extern void isp_erase_sector(uchar  num);
   6          extern uchar isp_read_byte(uint add);
   7          void delay2(uint x);
   8          
   9          uchar idata read_buf[58];       
  10          
  11          uchar  idata data_buf[58] = {
  12                  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
  13                  0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
  14                  0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23,
  15                  0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
  16                  0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39
  17          };
  18          
  19          void read(void);
  20          void write(void);
  21          
  22          void main()
  23          {
  24   1              uchar m;
  25   1              AUXR |= 0x01;           //disable ale
  26   1              isp_erase_sector(0);
  27   1              write();
  28   1              read();
  29   1      
  30   1      /*check EEPROM successful*/     
  31   1      while(1)
  32   1      {
  33   2              for (m = 0; m < 58; m++)
  34   2              {
  35   3              if(read_buf[m] !=data_buf[m])   //check fail
  36   3                      {
  37   4                      delay2(2000);   
  38   4                      P1 = 0xAA;                      
  39   4                      P3 = m;                                                 //show fail address
  40   4                      P2 = read_buf[m];                               //show read data
  41   4                      P0 = data_buf[m];                               //show correct data
  42   4                      }
  43   3                      
  44   3                      else{                                                   //check pass
  45   4                      delay2(100);
  46   4                      P1 = 0x55;}
  47   3      
  48   3              }
  49   2      }
  50   1      }
  51          
  52          void read(void)
  53          {
  54   1              uchar m;
C51 COMPILER V7.06   MAIN                                                                  10/31/2008 13:23:20 PAGE 2   

  55   1              for (m = 0; m < 58; m++) {
  56   2      
  57   2              read_buf[m] =isp_read_byte(m); 
  58   2              }
  59   1      
  60   1      }
  61          
  62          void write(void)
  63          {
  64   1              uchar m;
  65   1      
  66   1              for (m = 0; m < 58; m++) {
  67   2      
  68   2                      isp_program_byte(m, data_buf[m]);
  69   2      
  70   2              }
  71   1      
  72   1      }
  73          
  74          void delay2(uint x)   //1ms
  75          {
  76   1              uchar y;
  77   1              while (x--) {
  78   2                      y = 110;
  79   2                      while (y--) {
  80   3                              ;}
  81   2              }
  82   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    158    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       3
   IDATA SIZE       =    116    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
